class JukeboxButton
  def initialize(label, &action)
    @action = action
  end
  def buttonPressed
    @action.call(self)
  end
end

 
bStart = JukeboxButton.new("Start") { print "Start" }   
bPause = JukeboxButton.new("Pause") { print "Pause" }  

bStart.buttonPressed 
bPause.buttonPressed


def nTimes(aThing)  
  return proc { |n| print aThing * n , "\n"}  
end  
 
p1 = nTimes(23)  
p1.call(3)  
p1.call(4)  
p2 = nTimes("Hello ")  
p2.call(3)

3.times        { print "X " }
1.upto(5)      { |i| print i, " " }
99.downto(95)  { |i| print i, " " }
50.step(80, 5) { |i| print i, " " }

